<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Set"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%
    @SuppressWarnings("unchecked")
    HashMap<String, String> users = (HashMap<String, String>) application.getAttribute("users");
    Set<String> names = users.keySet();
    for (String name : names) {
      if (users.get(name).equals(session.getId())) {
        response.sendRedirect("hall");
      }
    }
%>
<!DOCTYPE html>
<html>
<head>
<title>访问大厅</title>
<script>
  function nonNull() {
    var val = document.forms[0]['your-name'];
    return !(val == null);
  }
</script>
</head>
<body>
  <form action="hall" method="post">
    <label>
      身份
      <input type="text" name="your-name">
    </label>
    <br>
    <input type="submit" value="进入" onclick="return nonNull()">
  </form>
</body>
</html>
